package cn.itsource.service.impl;

import cn.itsource.domain.Goods;
import cn.itsource.mapper.GoodsMapper;
import cn.itsource.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service

public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    //查询所有
    @Override
    public List<Goods> findAll() {
        return goodsMapper.findAll();
    }


    //添加
    @Override
    public void add(Goods goods) {
        goodsMapper.add(goods);
    }


    //修改
    @Override
    public void update(Goods goods) {
        goodsMapper.update(goods);
    }


    //删除
    @Override
    public void delete(int id) {
        goodsMapper.delete(id);
    }

    //根据id查询
    @Override
    public Goods findOne(int id) {
        return goodsMapper.findOne(id);
    }
}
